﻿using com.guojin.mj.net.message.game;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerHeadController : MonoBehaviour
{
    private PlayerHeadPage page;

    void Awake()
    {
        page = GetComponent<PlayerHeadPage>();
    }

    public void InitPlayerHead(GameUserInfoRet gameUser)
    {
        DownloadHeadPhoto(gameUser.avatar);
        SetPlayerHeadName(gameUser.userName);
        SetPlayerHeadTotalScore(gameUser.totalScore);
    }

    public void DownloadHeadPhoto(string url)
    {
        page.DownloadHeadPhoto(url);
    }

    public void SetPlayerHeadName(string name)
    {
        page.SetNameText(name);
    }

    public void SetPlayerHeadTotalScore(int score)
    {
        page.SetTotalScoreText(score);
    }

    public void SetTrusteeship(bool show)
    {
        page.SetTrusteeShipImg(show);
    }

    public void SetOutline(bool show)
    {
      page.SetOutlineImg(show);
    }

    public void SetSelect(bool show)
    {
      page.SetSelectImg(show);
    }

    public void SetPlayerHeadState(string userState) //大赢家 弃牌 输牌  聚锅
    {
        page.SetPlayerStateImg(userState);
    }

    public void SetDownTime(bool show, int time)
    {
       page.SetDownTime(show, time);
    }

    //public void SetReadyBtn(bool show)
    //{
    //    page.SetReadyBtn(show);
    //}
}


